|
|
|
Consider the multiple lists
example. The problem here with modular programming is, that you must
explicitly create and destroy your list handles. Then you use the procedures
of the module to modify each of your handles.
|
|
In contrast to that, in
object-oriented programming we would have as many list objects as needed.
Instead of calling a procedure which we must provide with the correct list
handle, we would directly send a message to the list object in question.
Roughly speaking, each object implements its own module allowing for example
many lists to coexist.
|
|
Each object is responsible
to initialize and destroy itself correctly. Consequently, there is no longer
the need to explicitly call a creation or termination procedure.
|
|
|